package repository;

import model.Hobby;
import model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

    @Query("SELECT u FROM User u WHERE u.name = :name AND u.firstName = :firstName")
    List<User> getUsersByNameAndFirstName(@Param("name") String name, @Param("firstName") String firstName);
}